#!/usr/bin/env python3
import requests

# 测试图片路径
image_path = "/Users/zhanghaining/git/qiu/1/8-组织1.0-400_level_.jpg"

# 发送请求
with open(image_path, 'rb') as f:
    files = {'image': f}
    data = {'classifier_name': 'jinxiang_ball'}
    response = requests.post("http://localhost:8796/api/v1/classify/single", files=files, data=data)

# 显示结果
if response.status_code == 200:
    result = response.json()
    print(f"类别: {result['class_name']}")
    print(f"置信度: {result['confidence']:.4f}")
else:
    print(f"错误: {response.status_code}")
